<?php
namespace Project\Model;


use Zend\InputFilter\Factory as InputFactory;     // <-- Add this import
use Zend\InputFilter\InputFilter;                 // <-- Add this import
use Zend\InputFilter\InputFilterAwareInterface;   // <-- Add this import
use Zend\InputFilter\InputFilterInterface;        // <-- Add this import

class Project implements InputFilterAwareInterface
{
	public $id;
	public $name;
	public $description;
	public $status;
	public $ownedsecurableitem_id;
	
	protected $inputFilter;                       // <-- Add this variable

	public function exchangeArray($data)
	{
		$this->id     = (isset($data['id']))     ? $data['id']     : null;
		$this->name = (isset($data['name'])) ? $data['name'] : null;
		$this->description  = (isset($data['description']))  ? $data['description']  : null;
		$this->status = (isset($data['status'])) ? $data['status'] : null;
		$this->ownedsecurableitem_id = (isset($data['ownedsecurableitem_id'])) ? $data['ownedsecurableitem_id'] : null;
	}
	public function getArrayCopy()
	{
		return get_object_vars($this);
	}

	// Add content to this method:
	public function setInputFilter(InputFilterInterface $inputFilter)
	{
		throw new \Exception("Not used");
	}

	public function getInputFilter()
	{
		if (!$this->inputFilter) {
			$inputFilter = new InputFilter();
			$factory     = new InputFactory();

			$inputFilter->add($factory->createInput(array(
					'name'     => 'id',
					'required' => true,
					'filters'  => array(
							array('name' => 'Int'),
					),
			)));

			$inputFilter->add($factory->createInput(array(
					'name'     => 'name',
					'required' => true,
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
					
			)));

			$inputFilter->add($factory->createInput(array(
					'name'     => 'description',
					'required' => true,
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
					
			)));
			$inputFilter->add($factory->createInput(array(
					'name'     => 'status',
					'required' => true,
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
					
			)));
			$inputFilter->add($factory->createInput(array(
					'name'     => 'ownedsecurableitem_id',
					'required' => true,
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
					
			)));

			$this->inputFilter = $inputFilter;
		}

		return $this->inputFilter;
	}
}